home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Mathematics / Notebooks / URichMultivariateCalculus / 07 / Lab7.ma next >
Encoding:
Text File  |  1992-08-19  |  19.2 KB  |  275 lines

  1. (*^
  2.  
  3. ::[paletteColors = 128; currentKernel; 
  4.     fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e8,  24, "Times"; ;
  5.     fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e6,  18, "Times"; ;
  6.     fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, L1, e6,  14, "Times"; ;
  7.     fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L1, a20,  18, "Times"; ;
  8.     fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L1, a15,  14, "Times"; ;
  9.     fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L1, a12,  12, "Times"; ;
  10.     fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  11.     fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  10, "Times"; ;
  12.     fontset = input, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L1,  12, "Courier"; ;
  13.     fontset = output, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5,  12, "Courier"; ;
  14.     fontset = message, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1,  12, "Courier"; ;
  15.     fontset = print, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1,  12, "Courier"; ;
  16.     fontset = info, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1,  12, "Courier"; ;
  17.     fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L1,  12, "Courier"; ;
  18.     fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1,  10, "Times"; ;
  19.     fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  20.     fontset = Left Header, nohscroll, cellOutline,  12;
  21.     fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, L1,  12;
  22.     fontset = Left Footer, cellOutline, blackBox,  12;
  23.     fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  10, "Times"; ;
  24.     fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  25.     fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12, "Courier"; ;
  26.     fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  27.     fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  28.     fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  29.     fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  30.     fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  31.     next21StandardFontEncoding; ]
  32. :[font = title; inactive; Cclosed; preserveAspect; startGroup; ]
  33. Lab 7: Integration
  34. :[font = text; inactive; preserveAspect; ]
  35. This lab shows how Mathematica evaluates multiple integrals in rectangular and spherical coordinates.  It also shows how the SphericalPlot3D command can be used to graph surfaces in spherical coordinates.
  36. ;[s]
  37. 4:0,0;19,1;30,2;124,3;328,-1;
  38. 4:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;
  39. :[font = section; inactive; Cclosed; preserveAspect; startGroup; ]
  40. The Integrate Command
  41. :[font = text; inactive; preserveAspect; ]
  42. The Integrate command can be used to evaluate integrals of various types: indefinite integrals, definite integrals, improper integrals, non-elementary integrals, and iterated integrals.
  43. ;[s]
  44. 3:0,0;3,1;14,2;186,-1;
  45. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  46. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  47. Examples
  48. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  49. The simplest version of the Integrate command produces the indefinite integral 
  50. (i.e. an antiderivative).  For example:
  51. ;[s]
  52. 3:0,0;27,1;38,2;119,-1;
  53. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  54. :[font = input; preserveAspect; ]
  55. Integrate[ x^2, x ]
  56. :[font = text; inactive; preserveAspect; ]
  57. The output is a function of the variable listed second.
  58. :[font = text; inactive; preserveAspect; endGroup; ]
  59. The x listed second stands for the "dx" in the integral.
  60. ;[s]
  61. 5:0,0;3,1;6,2;36,3;38,4;57,-1;
  62. 5:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  63. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  64. For the definite integral, the isolated x is replaced with a range for x, indicating the bounds on the integral.  For example:
  65. ;[s]
  66. 5:0,0;39,1;42,2;71,3;72,4;126,-1;
  67. 5:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  68. :[font = input; preserveAspect; ]
  69. Integrate[ Sin[x], {x,0,Pi} ]
  70. :[font = text; inactive; preserveAspect; endGroup; ]
  71. Here, the variable listed in the range (x in this example) is merely a dummy variable; the output does not depend upon it.
  72. ;[s]
  73. 3:0,0;40,1;42,2;122,-1;
  74. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  75. :[font = text; inactive; Cclosed; pageBreak; preserveAspect; startGroup; ]
  76. Improper integrals can be evaluated by Mathematica:
  77. ;[s]
  78. 3:0,0;39,1;50,2;52,-1;
  79. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  80. :[font = input; preserveAspect; endGroup; ]
  81. Integrate[ Exp[-x^2], {x,-Infinity,Infinity} ]
  82. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  83. Here is a non-elementary integral:
  84. :[font = input; preserveAspect; ]
  85. Integrate[ Sqrt[1-x^4], {x,0,1} ]
  86. :[font = text; inactive; preserveAspect; endGroup; ]
  87. As the output indicates, there is no (elementary) antiderivative of this function..  It involves the Gamma function, which is itself defined by an integral.
  88. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  89. However, Mathematica can still give a numerical (approximate decimal) answer:
  90. ;[s]
  91. 3:0,0;9,1;20,2;78,-1;
  92. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  93. :[font = input; preserveAspect; ]
  94. Integrate[ Sqrt[1-x^4], {x,0,1} ]  //  N
  95. :[font = text; inactive; preserveAspect; ]
  96. This is done by a method based upon the Trapezoidal Rule.
  97. :[font = text; inactive; preserveAspect; ]
  98. The NIntegrate command does the same thing:
  99. ;[s]
  100. 3:0,0;3,1;15,2;44,-1;
  101. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  102. :[font = input; preserveAspect; endGroup; endGroup; ]
  103. NIntegrate[ Sqrt[1-x^4], {x,0,1} ]
  104. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  105. Exercises
  106. :[font = text; inactive; preserveAspect; ]
  107. Use the Integrate command to evaluate the integrals given in the following exercises from our textbook:
  108. ;[s]
  109. 3:0,0;7,1;18,2;104,-1;
  110. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  111. :[font = text; inactive; preserveAspect; ]
  112. 1.  Exercise 43 on page 379 of Stein.
  113. :[font = text; inactive; preserveAspect; ]
  114. 2.  Exercise 65 on page 379 of Stein.
  115. :[font = text; inactive; preserveAspect; ]
  116. 3.  Exercise 77 on page 379 of Stein.
  117. :[font = text; inactive; preserveAspect; ]
  118. 4.  Exercise 111 on page 379 of Stein.
  119. :[font = text; inactive; preserveAspect; ]
  120. 5.  Exercise 153 on page 380 of Stein.
  121. :[font = text; inactive; preserveAspect; ]
  122. 6.  Exercise 3 on page 429 of Stein.
  123. :[font = text; inactive; preserveAspect; ]
  124. 7.  Exercise 5 on page 429 of Stein.
  125. :[font = text; inactive; preserveAspect; endGroup; endGroup; ]
  126. 8.  Exercise 68 on page 431 of Stein.
  127. :[font = section; inactive; Cclosed; pageBreak; preserveAspect; startGroup; ]
  128. Iterated Integrals
  129. :[font = text; inactive; preserveAspect; ]
  130. An iterated integral is a multi-dimensional integral that is evaluated by applying the Fundamental Theorem of Calculus (finding antiderivatives) repeatedly.
  131. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  132. Example
  133. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  134. Let S be the solid bounded by: 0 < x < 1, 0 < y < 2-x, x+y < z < 4.  Then the volume of the solid is given by the iterated iutegral:
  135. ;[s]
  136. 15:0,0;4,1;5,2;35,3;37,4;46,5;47,6;52,7;53,8;55,9;56,10;57,11;58,12;61,13;62,14;133,-1;
  137. 15:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  138. :[font = input; preserveAspect; endGroup; ]
  139. vol = Integrate[ Integrate[ Integrate[ 1, {z,x+y,4} ],
  140.                             {y,0,2-x} ], {x,0,1} ]
  141. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  142. Suppose the temperature at the point (x,y,z) in the solid is given by the function:
  143. ;[s]
  144. 7:0,0;38,1;39,2;40,3;41,4;42,5;43,6;84,-1;
  145. 7:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  146. :[font = input; preserveAspect; endGroup; ]
  147. temp[x_,y_,z_] := 1 + x^2 + y^2 + z^2 - 3x*y*z
  148. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  149. Then the average temperature throughout the solid is:
  150. :[font = input; preserveAspect; endGroup; endGroup; ]
  151. ave = (1/vol) Integrate[ Integrate[
  152.                 Integrate[ temp[x,y,z], {z,x+y,4} ],
  153.                         {y,0,2-x} ], {x,0,1} ]
  154. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  155. Exercises
  156. :[font = text; inactive; preserveAspect; ]
  157. Use the iterated Integrate command to work the following exercises in our textbook:
  158. ;[s]
  159. 3:0,0;16,1;27,2;84,-1;
  160. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  161. :[font = text; inactive; preserveAspect; ]
  162. 1.  Exercise 3 on page 705 of Stein.
  163. :[font = text; inactive; preserveAspect; ]
  164. 2.  Exercise 23 on page 706 of Stein.
  165. :[font = text; inactive; preserveAspect; ]
  166. 3.  Exercise 17 on page 720 of Stein.
  167. :[font = text; inactive; preserveAspect; endGroup; endGroup; ]
  168. 4.  Exercise 35 on page 722 of Stein.
  169. :[font = section; inactive; Cclosed; preserveAspect; startGroup; ]
  170. Graphs in Spherical Coordinates
  171. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  172. Mathematica provides a very useful command for graphing surfaces in spherical coordinates.  It is in the external packaged named ParametricPlot3D located in the Graphics directory of the /NextLibrary/Mathematica/Packages directory.  To load this package into memory, simply execute the command:
  173. ;[s]
  174. 8:0,0;11,1;128,2;146,3;160,4;170,5;186,6;221,7;295,-1;
  175. 8:1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  176. :[font = input; preserveAspect; ]
  177. <<Graphics`ParametricPlot3D`
  178. :[font = text; inactive; preserveAspect; endGroup; ]
  179. Do NOT execute this command more than once.
  180. :[font = subsection; inactive; Cclosed; pageBreak; preserveAspect; startGroup; ]
  181. Examples
  182. :[font = text; inactive; preserveAspect; ]
  183. Once the Graphics/ParametricPlot3D package has been loaded, Mathematica will be able to execute the SphericalPlot3D command.  This works like all other Plot commands: list the function whose graph is to be plotted, and then list the ranges on its independent variables.  In the spherical coordinates (r,f,q), f (phi) and q (theta) are usually taken to be the independent variables, and r (rho) is the dependent variable.  So the first thing listed is the value of the function  r = f (f,q).
  184. ;[s]
  185. 27:0,0;8,1;35,2;60,3;71,4;99,5;116,6;151,7;157,8;301,9;302,10;303,11;304,12;305,13;306,14;309,15;310,16;321,17;322,18;386,19;387,20;478,21;479,22;485,23;486,24;487,25;488,26;491,-1;
  186. 27:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  187. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  188. Our first example is the unit sphere.  It is the set of all points for which r = 1, so the function to be graphed is the constant function 1:
  189. ;[s]
  190. 3:0,0;77,1;78,2;141,-1;
  191. 3:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  192. :[font = input; preserveAspect; ]
  193. SphericalPlot3D[ 1, {s,0,Pi}, {t,0,2Pi}];
  194. :[font = text; inactive; preserveAspect; endGroup; ]
  195. Here we have used the full range on the independent variables: 0 to p for f, and 0 to 2 p for q.  (Note that, since Mathematica does not recognize Greek letters, we use s for f and t for q.)
  196. ;[s]
  197. 19:0,0;68,1;69,2;74,3;75,4;88,5;89,6;94,7;95,8;116,9;127,10;168,11;171,12;175,13;176,14;180,15;183,16;187,17;188,18;190,-1;
  198. 19:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  199. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  200. Our second example is the upper "sheet" of the hyperboloid of two sheets, whose equation in rectangular coordinates is  z^2 - x^2 - y^2 = 1, which simplifies to the polar (cylindrical) form:   z^2 - r^2 = 1.  Direct substitution of the polar transformation equations produces:  r^2 cos^2 f - r^2 sin^2 f = 1, which reduces to:  r^2 cos 2f= 1, or:   r^2 = sec 2f.  Then, solving for r results in the function:  Sqrt[sec 2f]:
  201. ;[s]
  202. 31:0,0;120,1;121,2;126,3;127,4;132,5;133,6;193,7;194,8;199,9;200,10;278,11;279,12;288,13;289,14;292,15;293,16;302,17;303,18;328,19;329,20;337,21;338,22;349,23;350,24;360,25;361,26;382,27;383,28;420,29;421,30;423,-1;
  203. 31:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  204. :[font = input; preserveAspect; ]
  205. SphericalPlot3D[ Sqrt[Sec[2s]], {s,0,Pi/6}, {t,0,2Pi} ];
  206. :[font = text; inactive; preserveAspect; endGroup; ]
  207. This isn't a very good perspective.
  208. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  209. To improve the image, we'll use the ViewPoint option.  We'll specify (in rectangular coordinates) the point (5,3,2) from which the view should be made:
  210. ;[s]
  211. 3:0,0;35,1;46,2;152,-1;
  212. 3:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  213. :[font = input; preserveAspect; ]
  214. SphericalPlot3D[ Sqrt[Sec[2s]], {s,0,0.7}, {t,0,2Pi},
  215.                 ViewPoint -> {5,3,2}];
  216. :[font = text; inactive; preserveAspect; endGroup; endGroup; ]
  217. Notice that we extended the range on phi from p/6 to 0.7.
  218. ;[s]
  219. 3:0,0;46,1;47,2;58,-1;
  220. 3:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  221. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  222. Exercise
  223. :[font = text; inactive; preserveAspect; endGroup; endGroup; ]
  224. Use the SphericalPlot3D command to graph the circular hyperboloid of one sheet (the nuclear power plant cooling tower) whose equation in rectangular coordinates is
  225. x^2 + y^2 - z^2 = 1.  Restrict phi to the interval p/3 to 2p/3.
  226. ;[s]
  227. 13:0,0;7,1;24,2;164,3;165,4;170,5;171,6;176,7;177,8;215,9;216,10;223,11;224,12;227,-1;
  228. 13:1,11,8,Times,0,12,0,0,0;1,10,8,Courier,1,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  229. :[font = section; inactive; Cclosed; pageBreak; preserveAspect; startGroup; ]
  230. Integrals in Spherical Coordinates
  231. :[font = text; inactive; preserveAspect; ]
  232. Integration in spherical coordinates requires the Jacobian  r^2 sin f.  After multiplying the integrand (the function to be integrated) by this factor, integration in Mathematica proceeds normally.
  233. ;[s]
  234. 7:0,0;60,1;61,2;68,3;69,4;167,5;178,6;198,-1;
  235. 7:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  236. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  237. Example
  238. :[font = text; inactive; Cclosed; preserveAspect; startGroup; ]
  239. Find the center of mass of that part of a sphere that lies above the cone whose half-vertex angle is p/4, assuming that the density of the object is proportional to the distance from the xy-plane.
  240. ;[s]
  241. 5:0,0;101,1;102,2;187,3;190,4;191,-1;
  242. 5:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,10,8,Times,2,12,0,0,0;
  243. :[font = input; preserveAspect; ]
  244. m = Integrate [ r^3 Sin[s] Cos[s], 
  245.                 {r,0,1}, {s,0,Pi/4}, {t,0,2Pi} ]
  246. :[font = input; preserveAspect; ]
  247. zm = Integrate [ r^4 Sin[s] Cos[s]^2, 
  248.                  {r,0,1}, {s,0,Pi/4}, {t,0,2Pi} ]
  249. :[font = input; preserveAspect; ]
  250. zm/m  //  Simplify
  251. :[font = input; preserveAspect; ]
  252. N[%]
  253. :[font = text; inactive; preserveAspect; endGroup; endGroup; ]
  254. The center of mass is about 69% to the top.
  255. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ]
  256. Exercises
  257. :[font = text; inactive; preserveAspect; ]
  258. 1.  Find the center of mass of that part of a sphere of uniform density that lies above the
  259.      cone whose half-vertex angle is p/3.  (Take the sphere's radius to be 1.)
  260. ;[s]
  261. 3:0,0;129,1;130,2;171,-1;
  262. 3:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  263. :[font = text; inactive; preserveAspect; ]
  264. 2.  Find the center of mass of the same object as in Exercise 1, but assume that the
  265.      object's density is proportional to the square of the distance from the xy-plane.
  266. ;[s]
  267. 2:0,0;162,1;172,-1;
  268. 2:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;
  269. :[font = text; inactive; preserveAspect; endGroup; endGroup; endGroup; ]
  270. 3.  Repeat problem 2 but with the spherical cap of the solid removed.
  271.      (Hint: Change the upper bound on r to sec s / 2.)
  272. ;[s]
  273. 6:0,0;108,1;109,2;117,3;118,4;121,5;122,-1;
  274. 6:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;
  275. ^*)